<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=0, width=device-width" />
		<title>header</title>
		<!--<link rel="stylesheet" type="text/css" href="../css/common.min.css" />-->
		<link rel="stylesheet" type="text/css" href="../css/mui.min.css" />
		<link rel="stylesheet" type="text/css" href="../css/app.css" />
		<link rel="stylesheet" type="text/css" href="../css/iconfont.css" />
		<style type="text/css">
			html,
			body {
				height: 100%;
				width: 100%;
			}
			
			#wrap {
				height: 100%;
				display: -webkit-box;
				display: -webkit-flex;
				display: flex;
				-webkit-box-orient: vertical;
				-webkit-flex-flow: column;
				flex-flow: column;
			}
			
			#main {
				-webkit-box-flex: 1;
				-webkit-flex: 1;
				flex: 1;
			}
			
			#main h4 {
				font-weight: 400;
				line-height: 24px;
				color: #070707
			}
		</style>

		<script src="../script/app.js" type="text/javascript" charset="utf-8"></script>
		<style type="text/css">
			#qrcode{
				width: 200px;
			}
		</style>
	</head>

	<body>

		<div id="wrap">
			<header id="header" class="mui-bar mui-bar-nav">
				<a class="mui-icon mui-pull-left mui-icon-left-nav" onclick="api.closeWin()"></a>
				<h1 class="mui-title">联系我们</h1>
			</header>
			<div id="main" style="margin-top: 45px;padding: 20px;">
				<h4 id="name"></h4>
				<h4>电话：<span id="phone"></span></h4>
				<h4>邮箱：<span id="email"></span></h4>
				<h4>地址：<span id="address"></span></h4>
				<h4>QQ：<span id="qq"></span></h4>
				<h4>微信：<span id="weixin"></span></h4>
				<h4><img id="qrcode"></h4>
				<h4 id="intro"></h4>
			</div>
		</div>
	</body>
	<script type="text/javascript" src="../script/api.js"></script>
	<script src="../script/app.js" type="text/javascript" charset="utf-8"></script>
	<script src="../script/mui.min.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
		function getInfo() {
			showWaiting();
			var model = api.require('model');
			var query = api.require('query');
			model.config({
				appId: 'A6982477094428',
				appKey: '9E6568DD-13A6-B15C-F54F-439675350D7C',
				host: 'https://d.apicloud.com'
			});
			model.findById({
				class: "CompanyInfo",
				id: '565e569dc04d2558107f9039'
			}, function(ret, err) {
				if (ret) {
					document.getElementById("name").innerHTML = ret.name;
					document.getElementById("qq").innerHTML = ret.qq;
					document.getElementById("email").innerHTML = ret.mail;
					document.getElementById("address").innerHTML = ret.address;
					document.getElementById("intro").innerHTML = ret.intro;
					document.getElementById("weixin").innerHTML = ret.weixin;
					document.getElementById("phone").innerHTML = ret.phone;
					if(ret.QRcode){
						document.getElementById("qrcode").src = ret.QRcode;
					}else{
						document.getElementById("qrcode").style.display="none";
					}
					hideWaiting();
				}
			});
		}
		apiready = function() {
			var data = api.pageParam;
			//			alert(JSON.stringify(data));
			var header = $api.byId('header');
			$api.fixIos7Bar(header);
			getInfo();
		}
	</script>

</html>